# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
_pkgname=csscompressor
pkgname="py3-$_pkgname"
pkgver=0.9.5
pkgrel=5
pkgdesc="Python port of YUI CSS Compressor"
url="https://github.com/sprymix/csscompressor"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-setuptools_scm"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
options="!check" # requires package to be installed
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	find csscompressor/tests -type f -name 'test_*.py' -exec python3 "$i" ';'
}

package() {
	python3 setup.py install --root "$pkgdir"

	# Remove tests
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/csscompressor/tests/
}

sha512sums="
aee16b5af8b1b780a0fef10d359864a5a21a90b7196740c8b7efef25d1ba4d8197e9fce03483d0e2331abc736290cc6b862e43ee65d1b76260310aea65fc6eb6  csscompressor-0.9.5.tar.gz
"
